package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.QuotaMapper;
import com.ruoyi.system.domain.Quota;
import com.ruoyi.system.service.IQuotaService;

/**
 * 配额Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-08
 */
@Service
public class QuotaServiceImpl implements IQuotaService 
{
    @Autowired
    private QuotaMapper quotaMapper;

    /**
     * 查询配额
     * 
     * @param id 配额主键
     * @return 配额
     */
    @Override
    public Quota selectQuotaById(Long id)
    {
        return quotaMapper.selectQuotaById(id);
    }

    /**
     * 查询配额列表
     * 
     * @param quota 配额
     * @return 配额
     */
    @Override
    public List<Quota> selectQuotaList(Quota quota)
    {
        return quotaMapper.selectQuotaList(quota);
    }

    /**
     * 新增配额
     * 
     * @param quota 配额
     * @return 结果
     */
    @Override
    public int insertQuota(Quota quota)
    {
        quota.setCreateTime(DateUtils.getNowDate());
        return quotaMapper.insertQuota(quota);
    }

    /**
     * 修改配额
     * 
     * @param quota 配额
     * @return 结果
     */
    @Override
    public int updateQuota(Quota quota)
    {
        quota.setUpdateTime(DateUtils.getNowDate());
        return quotaMapper.updateQuota(quota);
    }

    /**
     * 批量删除配额
     * 
     * @param ids 需要删除的配额主键
     * @return 结果
     */
    @Override
    public int deleteQuotaByIds(Long[] ids)
    {
        return quotaMapper.deleteQuotaByIds(ids);
    }

    /**
     * 删除配额信息
     * 
     * @param id 配额主键
     * @return 结果
     */
    @Override
    public int deleteQuotaById(Long id)
    {
        return quotaMapper.deleteQuotaById(id);
    }
}
